<?php
/**
 * Created by PhpStorm.
 * User: peter
 * Date: 2018/10/12
 * Time: 下午3:42
 */

namespace app\activity\controller;


use app\activity\logic\CollectionPoint;
use app\activity\logic\Configure;
use think\Request;

class Activity extends Base
{
    /**
     * @purpose 获取团期报名数据
     * @param Request $request
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function collectionPointTravelByGroupStage (Request $request)
    {
        $group_stage_id = $request->get('group_stage');
        return \app\activity\logic\Activity::collectionPointTravelByGroupStage($group_stage_id);
    }
    /**
     * @purpose 获取活动详情数据
     * @param Request $request
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function detail (Request $request)
    {
        $group_stage_id = $request->get('group_stage');
        return \app\activity\logic\Activity::detail($group_stage_id);
    }

    /**
     * @purpose 根据团期ID获取上车点
     * @param Request $request
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function collectionPointsByGroupStageId (Request $request)
    {
        $group_stage_id = $request->get('group_stage', 0);
        return CollectionPoint::itemByGroupStageId($group_stage_id);
    }

    /**
     * @purpose 获取活动客服信息
     * @return array
     */
    public function customer ()
    {
        return Configure::getConfigure('activity_customer');
    }
}